[gd_scene load_steps=28 format=2]

[ext_resource path="res://Scripts/Playable.cs" type="Script" id=1]
[ext_resource path="res://Sprites/Char/ralsei-temp-anim.png" type="Texture" id=2]
[ext_resource path="res://Scenes/Misc/InteractableCheck.tscn" type="PackedScene" id=3]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 17.5, 21 )

[sub_resource type="Animation" id=4]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 1 ]
}

[sub_resource type="Animation" id=8]
resource_name = "idle_down"
length = 0.1
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 0 ]
}

[sub_resource type="Animation" id=2]
resource_name = "idle_left"
length = 0.1
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:flip_h")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}

[sub_resource type="Animation" id=13]
resource_name = "idle_right"
length = 0.1
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:flip_h")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}

[sub_resource type="Animation" id=12]
resource_name = "idle_up"
length = 0.05
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 4 ]
}

[sub_resource type="Animation" id=3]
resource_name = "mov_down"
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2, 0.4, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3 ]
}

[sub_resource type="Animation" id=25]
resource_name = "mov_left"
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.4, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 10, 10, 11, 10, 9 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:flip_h")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}

[sub_resource type="Animation" id=26]
resource_name = "mov_right"
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.4, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 10, 10, 11, 10, 9 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:flip_h")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}

[sub_resource type="Animation" id=24]
resource_name = "mov_up"
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.2, 0.5, 0.8 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 5, 6, 7, 6 ]
}

[sub_resource type="AnimationNodeAnimation" id=20]
animation = "idle_up"

[sub_resource type="AnimationNodeAnimation" id=21]
animation = "idle_down"

[sub_resource type="AnimationNodeAnimation" id=22]
animation = "idle_left"

[sub_resource type="AnimationNodeAnimation" id=23]
animation = "idle_right"

[sub_resource type="AnimationNodeBlendSpace2D" id=5]
blend_point_0/node = SubResource( 20 )
blend_point_0/pos = Vector2( 0, -1 )
blend_point_1/node = SubResource( 21 )
blend_point_1/pos = Vector2( 0, 1 )
blend_point_2/node = SubResource( 22 )
blend_point_2/pos = Vector2( -1, 0 )
blend_point_3/node = SubResource( 23 )
blend_point_3/pos = Vector2( 1, 0 )
blend_mode = 1

[sub_resource type="AnimationNodeAnimation" id=27]
animation = "mov_left"

[sub_resource type="AnimationNodeAnimation" id=28]
animation = "mov_right"

[sub_resource type="AnimationNodeAnimation" id=29]
animation = "mov_up"

[sub_resource type="AnimationNodeAnimation" id=30]
animation = "mov_down"

[sub_resource type="AnimationNodeBlendSpace2D" id=11]
blend_point_0/node = SubResource( 27 )
blend_point_0/pos = Vector2( -0.8, 0 )
blend_point_1/node = SubResource( 28 )
blend_point_1/pos = Vector2( 0.8, 0 )
blend_point_2/node = SubResource( 29 )
blend_point_2/pos = Vector2( 0, -1 )
blend_point_3/node = SubResource( 30 )
blend_point_3/pos = Vector2( 0, 1 )
blend_mode = 1

[sub_resource type="AnimationNodeStateMachineTransition" id=31]

[sub_resource type="AnimationNodeStateMachineTransition" id=32]

[sub_resource type="AnimationNodeStateMachine" id=6]
states/Idle/node = SubResource( 5 )
states/Idle/position = Vector2( 530, 90 )
states/Movement/node = SubResource( 11 )
states/Movement/position = Vector2( 710, 82 )
transitions = [ "Idle", "Movement", SubResource( 31 ), "Movement", "Idle", SubResource( 32 ) ]
start_node = "Idle"

[sub_resource type="AnimationNodeStateMachinePlayback" id=7]

[node name="Playable" type="KinematicBody2D"]
collision_layer = 2
collision_mask = 5
script = ExtResource( 1 )

[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -4 )
scale = Vector2( 2.44676, 2.35889 )
texture = ExtResource( 2 )
hframes = 4
vframes = 3
frame = 1

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( -0.5, 23 )
shape = SubResource( 1 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 4 )
anims/idle_down = SubResource( 8 )
anims/idle_left = SubResource( 2 )
anims/idle_right = SubResource( 13 )
anims/idle_up = SubResource( 12 )
anims/mov_down = SubResource( 3 )
anims/mov_left = SubResource( 25 )
anims/mov_right = SubResource( 26 )
anims/mov_up = SubResource( 24 )

[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource( 6 )
anim_player = NodePath("../AnimationPlayer")
active = true
parameters/playback = SubResource( 7 )
parameters/Idle/blend_position = Vector2( -0.0792393, 0.258621 )
parameters/Movement/blend_position = Vector2( 0.00316954, -0.853448 )

[node name="InteractableCheck" parent="." groups=["Player"] instance=ExtResource( 3 )]
position = Vector2( -5, 21 )

[connection signal="body_entered" from="InteractableCheck" to="." method="interactRangeBodyEntered"]
[connection signal="body_exited" from="InteractableCheck" to="." method="interactRangeBodyExited"]
